//
//  DYShopInfoVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/21.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYShopInfoVC.h"
#import "DYAddBranchShopCell.h"
#import "DYShopDecorateCell.h"
#import "DYShopDecorateInputInfoCell.h"
#import "DYShopInfoCell.h"

@interface DYShopInfoVC ()

@property (nonatomic,strong)NSArray *titleArray;

@property (nonatomic,strong)NSMutableArray *shopLogoArray;
@property (nonatomic,strong)NSMutableArray *shopShowArray;
@property (nonatomic,strong)NSMutableArray *shopInteriorArray;


@end

@implementation DYShopInfoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"商铺信息";
}
-(void)dy_initData
{
    [super dy_initData];
    
    self.shopLogoArray=[NSMutableArray array];
    self.shopShowArray=[NSMutableArray array];
    self.shopInteriorArray=[NSMutableArray array];
    
    self.titleArray=@[@"店铺名称",@"店铺标志",@"店铺全称",@"行业",@"店铺地址",@"详细地址",@"店铺电话",@"营业时间",@"店铺标语",@"店铺简介",@"门头展示：",@"内景展示：",@"商家认证"];

}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.tableView.backgroundColor=WhiteColor;
    
    [self.tableView registerClass:[DYAddBranchShopCell class] forCellReuseIdentifier:@"DYAddBranchShopCell"];
    [self.tableView registerClass:[DYShopDecorateCell class] forCellReuseIdentifier:@"DYShopDecorateCell"];
    [self.tableView registerClass:[DYShopDecorateSeletedCell class] forCellReuseIdentifier:@"DYShopDecorateSeletedCell"];
    [self.tableView registerClass:[DYShopDecorateInputInfoCell class] forCellReuseIdentifier:@"DYShopDecorateInputInfoCell"];
    [self.tableView registerClass:[DYShopInfoCell class] forCellReuseIdentifier:@"DYShopInfoCell"];
    [self.tableView registerClass:[DYShopInfoAuthCell class] forCellReuseIdentifier:@"DYShopInfoAuthCell"];
    
    self.tableView.showsVerticalScrollIndicator=NO;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 13;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==1) {
        return BILIHEIGHT(100);
    }else  if (indexPath.row==12) {
        if (self.shopInteriorArray.count>=5) {
            return BILIHEIGHT(180);
        }
        return BILIHEIGHT(100);
    }else if (indexPath.row==9){
        return BILIHEIGHT(180);
    }else if (indexPath.row==10||indexPath.row==11){
        return BILIHEIGHT(130+115);
    }else if (indexPath.row==12){
        return BILIHEIGHT(80);
    }
    return BILIHEIGHT(58);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==1) {

        DYShopDecorateCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYShopDecorateCell" forIndexPath:indexPath];
        cell.titleLabel.text=self.titleArray[indexPath.row];
        cell.imageNumber=1;
        
        return cell;
    }else if (indexPath.row==9){
        DYShopDecorateInputInfoCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYShopDecorateInputInfoCell" forIndexPath:indexPath];
        cell.infoTextView.userInteractionEnabled=NO;
        cell.infoTextView.dy_placeHolder=@"";
        return cell;
    }else if (indexPath.row==10||indexPath.row==11){
        DYShopInfoCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYShopInfoCell" forIndexPath:indexPath];
        cell.titleLabel.text=self.titleArray[indexPath.row];
        return cell;
    }else if (indexPath.row==12){
        DYShopInfoAuthCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYShopInfoAuthCell" forIndexPath:indexPath];

        return cell;
    }
    DYAddBranchShopCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYAddBranchShopCell" forIndexPath:indexPath];
    
    cell.titleLabel.text=self.titleArray[indexPath.row];
    cell.textField.enabled=NO;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
